    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
        <%--
          Created by IntelliJ IDEA.
          User: admin
          Date: 2021/12/15
          Time: 10:01
          To change this template use File | Settings | File Templates.
        --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath()+"/";%>
<html>
<head>
    <base href="<%=path%>">
    <title>Title</title>
    <link href="static/css/bootstrap.min.css?v=3.3.7" rel="stylesheet" />
    <link href="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.css" rel="stylesheet">

</head>
<style>
</style>
<body style="overflow-y: scroll;height: 1200px;">
<form class="form-horizontal" id="form1">
    <input type="hidden" name="id" value="${menu.id}">
    <input type="hidden" name="parentId" <c:choose><c:when test="${not empty parentMenu}">value="${parentMenu.id}"</c:when><c:otherwise>value="${menu.parentId}</c:otherwise></c:choose>" id="parentId"/>
    <div class="form-group">
        <label  class="col-sm-2 control-label">上级菜单</label>
        <div class="col-sm-10">
            <input type="text" value="${parentMenu.menuName}" id="parentName" readonly class="form-control" onclick="selectMenus();">
        </div>
    </div>
    <div class="form-group">
        <label  class="col-sm-2 control-label">菜单类型</label>
        <div class="col-sm-10">
    目录 <input type="radio" name="menuType"  value="0">
    菜单 <input type="radio" name="menuType"  value="1">
    按钮 <input type="radio" name="menuType"  value="2">
        </div>
    </div>
    <div class="form-group">
    <label  class="col-sm-2 control-label">菜单名称</label>
    <div class="col-sm-10">
    <input type="text" class="form-control" name="menuName" value="${menu.menuName}">
    </div>
    </div>

    <div class="form-group">
    <label  class="col-sm-2 control-label">请求地址</label>
    <div class="col-sm-10">
    <input type="text" class="form-control" name="url" value="${menu.url}">
    </div>
    </div>

    <div class="form-group">
    <label  class="col-sm-2 control-label">打开方式</label>
    <div class="col-sm-10">
    <select class="form-control">
    <option value="0">页签</option>
    <option value="1">新窗口</option>
    </select>
    </div>
    </div>

    <div class="form-group">
    <label  class="col-sm-2 control-label">权限标识</label>
    <div class="col-sm-10">
    <input type="text" class="form-control" name="permission" value="${menu.permission}">
    </div>
    </div>
    <div class="form-group">
    <label  class="col-sm-2 control-label">显示顺序</label>
    <div class="col-sm-10">
    <input type="text" class="form-control" name="menuSort" value="${menu.menuSort}">
    </div>
    </div>

    <div class="form-group">
    <label  class="col-sm-2 control-label">显示图标</label>
    <div class="col-sm-10">
    <input type="text" class="form-control" name="menuIcon" value="${menu.menuIcon}">
    </div>
    </div>

    <div class="form-group">
        <label  class="col-sm-2 control-label">状态</label>
        <div class="col-sm-10">
            <select class="form-control" name="status">
                <option value="0">启用</option>
                <option value="1">禁用</option>
            </select>
        </div>
    </div>
    <div class="form-group">
    <label  class="col-sm-2 control-label">是否刷新</label>
    <div class="col-sm-10">
    是 <input type="radio" name="isRefresh"  value="0">
    否 <input type="radio" name="isRefresh"  value="1">
    </div>
    </div>
    <div class="form-group">
        <label  class="col-sm-2 control-label">备注</label>
        <div class="col-sm-10">
            <textarea name="message" class="form-control" rows="3"></textarea>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" id="save" class="btn btn-default">保存</button>
            <button type="reset" class="btn btn-default">重置</button>
        </div>
    </div>
</form>
</body>
<script src="static/js/jquery.min.js?v=2.1.4"></script>
<script src="static/js/bootstrap.min.js?v=3.3.7"></script>
<script src="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/bootstrap-table@1.15.3/dist/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="static/js/plugins/layer/layer.min.js"></script>
<script src="static/sofwin.js"></script>
<script>
    var index;
    function changeParent(parentId,parentName){
        $("#parentId").val(parentId);
        $("#parentName").val(parentName);
    }
    function close(){
        layer.close(index);
    }
    function selectMenus(){
        index = layer.open({
        type:2,
        scrollbar:true,
        content:'menu/treeView',
        title:'选择父级资源',
        area:['400px','400px']
    });
    }
    $(function(){
        $("#save").click(function(){
            $.operator.post('menu/save',$("#form1").serialize(),function(ret){
                if(ret.code==200){
                    layer.msg('操作成功',function(){
                       // 关闭
                        window.parent.refresh();
                        window.parent.close();
                    });
                }else{
                    layer.msg(ret.message);
                }
            })
        })
    })
</script>
</html>
